package com.quasar.hpatient.module.comm_compile;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.quasar.hpatient.module.comm_compile_step1.CompileStep1Fragment;
import com.quasar.hpatient.module.comm_compile_step2.CompileStep2Fragment;

/**
 * description: 完善信息
 * created by kalu on 2018/4/9 11:10
 */
public class CompileAdapter extends FragmentPagerAdapter {

    private final CompileStep1Fragment step1 = new CompileStep1Fragment();
    private final CompileStep2Fragment step2 = new CompileStep2Fragment();

    public CompileAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public Fragment getItem(int position) {
        return position == 0 ? step1 : step2;
    }

    public boolean isNull(int position) {
        if (position == 0) {
            return step1.isNull();
        } else {
            return step2.isNull();
        }
    }
}